package org.apogee.mil.client.widgets;

import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;

public class MessageWidget implements IsWidget {

	private TextArea editor = new TextArea();
	
	@Override
	public Widget asWidget() {
		ContentPanel cp = new ContentPanel();
		cp.setHeading("Message");
		cp.setHeaderVisible(true);
		cp.setAutoHeight(true);
		cp.setAutoWidth(true);
		cp.setBorders(true);
		
		editor.setHeight(400);
		editor.setWidth(600);
		editor.setMaxLength(2000);
		
		cp.add(editor);
				
		return cp;
	}
	
	public String getMessage() {
		return editor.getValue();
	}
	
	public void resetMessage() {
		editor.setValue("");
	}

}
